]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/icon-theme: Replace slice allocator
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 25 Jan 2023 17:36:08 +0000 (18:36 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 2 Feb 2023 20:45:06 +0000 (20:45 +0000)
Its use has been discouraged for years, and glib recently deprecated
it officially (while turning it around a small wrapper around malloc).

Don't let it sneak back in through some old GTK3 code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2620>

src/st/st-icon-theme.c

index 223aecb6af7bf335ac392750438ead64fd504c20..d024f8837e4c4060a9b43c88d56a0bce6c64baad 100644 (file)
@@ -500,7 +500,7 @@ free_dir_mtime (IconThemeDirMtime *dir_mtime)
     _gtk_icon_cache_unref (dir_mtime->cache);
 
   g_free (dir_mtime->dir);
-  g_slice_free (IconThemeDirMtime, dir_mtime);
+  g_free (dir_mtime);
 }
 
 static gboolean
@@ -810,7 +810,7 @@ insert_theme (GtkIconTheme *icon_theme,
       path = g_build_filename (icon_theme->search_path[i],
                                theme_name,
                                NULL);
-      dir_mtime = g_slice_new (IconThemeDirMtime);
+      dir_mtime = g_new (IconThemeDirMtime, 1);
       dir_mtime->cache = NULL;
       dir_mtime->dir = path;
       if (g_stat (path, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode)) {
@@ -925,7 +925,7 @@ free_unthemed_icon (UnthemedIcon *unthemed_icon)
 {
   g_free (unthemed_icon->svg_filename);
   g_free (unthemed_icon->no_svg_filename);
-  g_slice_free (UnthemedIcon, unthemed_icon);
+  g_free (unthemed_icon);
 }
 
 static char *
@@ -995,7 +995,7 @@ add_unthemed_icon (GtkIconTheme *icon_theme,
     }
   else
     {
-      unthemed_icon = g_slice_new0 (UnthemedIcon);
+      unthemed_icon = g_new0 (UnthemedIcon, 1);
 
       unthemed_icon->is_resource = is_resource;
 
@@ -1041,7 +1041,7 @@ load_themes (GtkIconTheme *icon_theme)
     {
       dir = icon_theme->search_path[base];
 
-      dir_mtime = g_slice_new (IconThemeDirMtime);
+      dir_mtime = g_new (IconThemeDirMtime, 1);
       icon_theme->dir_mtimes = g_list_prepend (icon_theme->dir_mtimes, dir_mtime);
 
       dir_mtime->dir = g_strdup (dir);
@@ -4188,7 +4188,7 @@ async_symbolic_data_free (AsyncSymbolicData *data)
 {
   if (data->dup)
     g_object_unref (data->dup);
-  g_slice_free (AsyncSymbolicData, data);
+  g_free (data);
 }
 
 static void
@@ -4277,7 +4277,7 @@ gtk_icon_info_load_symbolic_async (GtkIconInfo          *icon_info,
 
   task = g_task_new (icon_info, cancellable, callback, user_data);
 
-  data = g_slice_new0 (AsyncSymbolicData);
+  data = g_new0 (AsyncSymbolicData, 1);
   g_task_set_task_data (task, data, (GDestroyNotify) async_symbolic_data_free);
 
   data->is_symbolic = gtk_icon_info_is_symbolic (icon_info);